<?php
    
    require_once('SmartyReady.php');
    // preparem l'smarty
    $sm = new SmartyReady();
    $sm->muntarTemplates();
    // preparem la sessio
    session_start();
    if (empty($_SESSION['username'])) {
        $sm->assign('banner','login.tpl');
    }
    else {
        $sm->assign('banner','bannerUser.tpl');
        $sm->assign('usuari',$_SESSION['username']);
        $sm->assign('pathAvatar',$_SESSION['avatar']);
        ?><meta http-equiv="Refresh" content="0;url=./perfil.php"><?php
    }
    $sm->assign('resultatLogin','');
    $sm->assign('cuerpo','cuerpoindex.tpl');
    $sm->display("E:/wamp/www/JediMusic/Smarty/templates/base.tpl");
?>
